package sg.edu.nus.iss.cats.controller;

import sg.edu.nus.iss.cats.dataaccess.*;
import sg.edu.nus.iss.cats.model.*;

public class DepartmentManager {

    private DepartmentDAO departmentDAO = null;
    public DepartmentManager() {
           departmentDAO = DAOFactory.getInstance().getDepartmentDAO();
    }

    public Department[] findAllDepartments ()  throws  DAOException {

        //Get Department from DB
        return departmentDAO.findAllDepartments();
    }

    public Department findDepartment (String departmentId)  throws  DAOException {

        //Get Department from DB
        return departmentDAO.findDepartment(departmentId);
    }


    public void insertDepartment (Department department)  throws  DAOException {

        //Get Department from DB
        departmentDAO.insertDepartment(department);
    }
    public void updateDepartment (Department department)  throws  DAOException {

        //Get Department from DB
        departmentDAO.updateDepartment(department);
    }

    
    public void deleteDepartment (String departmentId)  throws  DAOException {

        //Get Department from DB
        departmentDAO.deleteDepartment(departmentId);
    }
    
    
   
}